import request from '@/utils/request'

const api = {
  orders: '/orders'
}

export function getOrders(params) {
  return request({
    url: api.orders,
    method: 'get',
    params,
    cache: true
  })
}

export function getOrderDetail(id) {
  return request({
    url: `${api.orders}/${id}`,
    method: 'get',
    cache: true
  })
}

export function putOrder(data) {
  return request({
    url: `${api.orders}/${data.id}`,
    method: 'put',
    data,
    cache: true
  })
}

